#include <iostream>
#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 100;
vector<int> G[MAXN];
int V; // 顶点的数目
int color[MAXN];

bool dfs(int n, int c) {
    if (color[n] != 0) {
        if (color[n] != c) return false;
        return true; 
    }
    color[n] = c;
    for (int i = 0; i < G[n].size(); i++) {
        if (!dfs(G[n][i], -c)) return false;
    }
    return true;
}

void solve() {
    for (int i = 0; i < V; i++) {
        if (color[i] == 0) {
            if (!dfs(i, 1)) {
                cout << "No" << endl;
                return;
            }
        } 
    }
    cout << "Yes" << endl;
}

int main() {
    V = 4;
    G[0].push_back(1); G[0].push_back(3); G[0].push_back(2);
    G[1].push_back(0); G[1].push_back(2);
    G[2].push_back(1); G[2].push_back(3);
    G[3].push_back(0); G[3].push_back(2);
    solve();
    return 0;
}

bool stardard_dfs(int v, int c) {
    color[v] = c; // 首先进行涂色
    for (int i = 0; i < G[v].size(); i++) {
        if (color[G[v][i]] == c) return false;
        if (color[G[v][i]] == 0 && !dfs(G[v][i], -c)) return false;
    }
    return true;
}

